import { axiosInstance } from "./config";
import { 
    PartitionType,
    createPartitionTypes
} from '../models'
import { 
    URL_PARTITION,
    URL_RANKING_PARTITIONS,
    URL_RANKING
} from './url'

// const mapPartitionListToModel = ({data}:any):PartitionType[] => {
//     console.log(data)
//     const partitions = data["0"];
//     let oneLevels =  createPartitionTypes(partitions);
//     oneLevels = oneLevels.filter((partition) => 
//         [13, 23, 11, 177].indexOf(partition.id) === -1);
//     // console.log(oneLevels)
//     return oneLevels;
// }

export const getPartitionsRequest = () => 
    axiosInstance.get(URL_PARTITION)

export const getRankingPartitionsRequest = () =>
    axiosInstance.get(URL_RANKING_PARTITIONS)

export const getRankingRequest = (rId:string) => {
    let url = `${URL_RANKING}/${rId}`
    return axiosInstance.get(url)
}